
<h2>Directory & File Permission</h2>

<div>
    <fieldset>
        <legend>Directory & File Permission</legend>
        <div class='fieldset-inside'>
        <?php if(!empty($areNotWriteable)){?>
            <span class="bold">Directories below are not writable!</span> 
            Please correct the permission so that MyMeeting can work properly. 
            <br />
            <br />
            To make it writable, do the following commands in terminal inside mymeeting folder:(for Linux only)<br />
            <span class="bold">
                1. sudo chmod -R 777 app/config<br />
                2. sudo chmod -R 777 app/tmp<br />
                3. sudo chmod -R 777 app/webroot<br />
            </span>
            <p></p>
            <br />
            <?php foreach($areNotWriteable as $dir){ ?>
                <ul class="chmodfail">
                    <li><?php echo $dir; ?></li>
                </ul>
                <br />
            <?php } ?>
            <br />
            Note: in case of tmp/ directory all the subdirectories need to be writeable as well
            <br />
        <?php } ?>
        <p>&nbsp;</p>
        
        <?php if(!empty($areWritable)){?>
            <span class="bold">Directories below are writable.</span>
            <?php foreach($areWritable as $dir){ ?>
                <ul class="chmodsuccess">
                    <li><?php echo $dir; ?></li>
                </ul>
                <br />
        <?php 
            } 
        }
        ?>
        </div>
    </fieldset>
    <?php
        echo $form->create(array('controller'=>'installers','action'=>'dircheck'));
        echo $form->button('Cancel', array('type'=>'button', 'onclick'=>'history.go(-1)'));
        echo '&nbsp;';
        if (count($areNotWriteable))
            echo $form->button('Try again',array('type'=>'submit'));
        else 
            echo $form->button('Next',array('type'=>'button','onclick'=>'parent.location=\'database\''));
        echo $form->end();
    ?>
</div>
